Skip to content

gh-153569: simplify tokenizer state - #156484

Draft
pablogsal wants to merge 11 commits into
python:mainfrom
pablogsal:gh-153569-tokenizer-validation-tools-clean
Draft

gh-153569: simplify tokenizer state#156484
pablogsal wants to merge 11 commits into
python:mainfrom
pablogsal:gh-153569-tokenizer-validation-tools-clean

Conversation

@pablogsal

@pablogsal pablogsal commented Aug 27, 2026

Copy link
Copy Markdown
Member

The tokenizer was keeping several versions of the same information and then repairing them when input moved. F- and t-string openings, expressions, and comments now use source spans and a single start location; token columns come from the line pointer, and failures come from the existing status.

The reader now owns its interactive state and pointer relocation, so the old cursor and buffer helpers, source aliases, extra error flag, and multiline location fields are gone. This is the next part of #153569 after #156482.

Comment thread Modules/_xxtestfuzz/fuzzer.c Outdated
}

static int
fuzz_tokenizer(const char *data, size_t size)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move it to python/library-fuzzers (yes, name is a little misleading). We aren't adding anything to _xxtestfuzz as we are planning to move it all to the repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablogsal a little ping FYI, since I see you're working on this.

@pablogsal pablogsal reopened this Aug 27, 2026
@pablogsal

Copy link
Copy Markdown
Member Author

Do not review until #156482 lands.

@pablogsal
pablogsal force-pushed the gh-153569-tokenizer-validation-tools-clean branch from 5505010 to 68400fb Compare August 28, 2026 18:40
@pablogsal pablogsal changed the title gh-153569: add tokenizer validation tools gh-153569: move f-string state to source spans Aug 28, 2026
@pablogsal
pablogsal force-pushed the gh-153569-tokenizer-validation-tools-clean branch from 68400fb to 7432a67 Compare August 28, 2026 19:35
@pablogsal
pablogsal force-pushed the gh-153569-tokenizer-validation-tools-clean branch from bb197e7 to 962c0c5 Compare August 28, 2026 22:44
@pablogsal
pablogsal force-pushed the gh-153569-tokenizer-validation-tools-clean branch from 962c0c5 to eae3e33 Compare August 28, 2026 23:48
@pablogsal pablogsal changed the title gh-153569: move f-string state to source spans gh-153569: simplify tokenizer state Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants